package com.broada.apm.utils;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;

import com.broada.apm.ApmServer;

public class ApmFileUtils {
	
	/**
	 * path相对路径 user.dir
	 * @param path
	 * @return
	 */
	public static File getFile(String path) {
		File file = new File(ApmServer.USER_DIR, path);
		return file;
	}
	
	/**
	 * 绝对路径
	 * @param absolutePath
	 * @return
	 */
	public static File getAbsoluteFile(String absolutePath) {
		File file = new File(absolutePath);
		return file;
	}
	
	public static File createTempDirectory(String path) throws IOException {
		return Files.createTempDirectory(path).toFile();
	}
}
